<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>第二题</title>
</head>

<body>
    <script>
        function getArray() {
            const arr = [12, 15, 45, 78, 56, 23, 36, 9, 52, 10, 11, 13, 14]
            const newArray = []
            let num = 0
            for (let i = 0; i < arr.length; i++) {
                if (arr[i] % 3 != 0) {
                    newArray.push(arr[i])
                    num += arr[i]
                }
            }
            console.log(newArray)
            return num
        }
        const arr1 = getArray()
        console.log(`能被3整除之外的所有元素的和为：${arr1}`)
    </script>
</body>

</html>